<!DOCTYPE html>
<html>

<head>
    <title>{$category.name} {$category.seo_title} {$site_info.site_name|default=''}</title>
    <meta name="keywords" content="{$category.seo_keywords},{$site_info.site_seo_keywords|default=''}" />
    <meta name="description" content="{$category.seo_description},{$site_info.site_seo_description|default=''}">
    <include file="public@head" />
    <hook name="before_head_end" />
</head>

<body class="bg-light">
    <include file="public@nav" />
    <section class="bg-light py-4">
        <div class="container">
            <div class="text-center text-dark">
                <p><span class="badge badge-info">{$category.name}</span></p>
                <h2>{$category.name}</h2>
                <div class="article-infobox">
                    {$category.description}
                </div>
            </div>
        </div>
    </section>
    <section class="container mb-3">
        <div class="row">
            <div class="col-2">
                <div class="mb-3">
                    <a href="{:cmf_url('portal/article/add')}" class="btn btn-primary btn-block"><i class="fa fa-edit"></i> 发表新话题</a>
                </div>
                <div class="card border-0 mb-3 category sticky-top">
                    <div class="card-body">
                        <p><i class="fa fa-list"></i> 所有分类</p>
                        <ul class="list-unstyled  m-0">
                            <portal:categories item="vo" order="list_order ASC">
                                <li data-id="8" class="pt-3 clearfix">
                                    <a href="{:cmf_url('portal/List/index',array('id'=>$vo.id))}" class="<if condition="$category.id eq $vo.id">active text-info font-weight-bold<else/>text-dark</if> " >
                                        <empty name="$vo.more.thumbnail">
                                            <img src="/assets/dist/images/default-thumbnail.png" style="width:24px;" class="rounded" alt="{$vo.name}">
                                            <else/>
                                            <img src="{:cmf_get_image_url($vo.more.thumbnail)}" style="width:24px;" class="img-fluid rounded" alt="{$vo.name}">
                                        </empty>
                                        <span class="mx-3" style="position:absolute;margin-top:1px;">{$vo.name}</span></a>
                                </li>
                            </portal:categories>
                        </ul>
                    </div>
                </div>
                <div class="card border-0 mb-3">
                    <div class="card-body">
                        <div class="text-center">
                            关注微信公众号
                            <br><span class="badge badge-info">新梅陇客栈</span>
                            <img src="/assets/dist/images/qrcode.jpg" class="img-fluid">
                        </div>
                    </div>
                </div>
                <div class="card border-0 mb-3">
                    <div class="card-body">
                        <h6>关于社区</h6>
                        <ul class="list-unstyled">
                            <li><a href="{:cmf_url('portal/Page/index',array('id'=>40))}">联系我们</a></li>
                            <li><a href="{:cmf_url('portal/Page/index',array('id'=>39))}">关于我们</a></li>
                            <li><a href="{:cmf_url('portal/Page/index',array('id'=>39))}">近期活动</a></li>
                        </ul>
                        <h6>快捷联系</h6>
                        <ul class="list-unstyled m-0">
                            <li><a href="tel:(+86) 159-2158-7537"><i class="fa fa-phone"></i> 159-2158-7537</a></li>
                            <li><a href="mailto:supu@vip.qq.com"><i class="fa  fa-envelope-o"></i> supu@vip.qq.com</a></li>
                        </ul>
                    </div>
                </div>
            </div>
            <div class="col-7">
                <div class="card border-0">
                    <div class="card-body">
                        <php>
                            $where=[ 'post.create_time'=>['egt',0] ];
                        </php>
                        <ul class="list-unstyled">
                            <portal:articles order="post.published_time DESC" relation="categories" page="10" where="$where" order="post.create_time DESC" categoryIds="$category.id">
                                <li class="media">
                                    <div style="width: 42px;" class="mr-3">
                                        <empty name="$vo.user.avatar">
                                            <img src="/assets/dist/images/headicon_128.png" class="img-fluid rounded-circle" alt="{$vo.post_title}">
                                            <else/>
                                            <img src="{:cmf_get_user_avatar_url($vo.user.avatar)}" class="img-fluid rounded-circle" alt="{$vo.post_title}">
                                        </empty>
                                    </div>
                                    <div class="media-body">
                                        <h6 class="mt-0 mb-1">
                                            <a class="text-dark" href="{:cmf_url('portal/Article/index',array('id'=>$vo.id,'cid'=>$vo.category_id))}">{$vo.post_title}</a>
                                        </h6>
                                        <p class="text-muted">
                                            <empty name="$vo.user.user_nickname">
                                                {$vo.user.user_login}
                                                <else/> {$vo.user.user_nickname}
                                            </empty> 发布于 {:func_friendly_time($vo.published_time)}
                                            <foreach name="$vo.categories" item="cat">
                                                <span class="badge badge-info float-right">{$cat.name}</span>
                                            </foreach>
                                        </p>
                                        <blockquote>
                                            <php>
                                                $post_excerpt = str_replace("\n", "", strip_tags($vo['post_content'])); $post_excerpt = msubstr($post_excerpt,0,120);
                                            </php>
                                            {$post_excerpt}
                                        </blockquote>
                                    </div>
                                </li>
                                <hr style="border-top: 1px solid #f5f6f7; " class="nopadding py-2">
                            </portal:articles>
                        </ul>
                        <ul class="pagination mx-auto mb-0">
                            <page/>
                        </ul>
                    </div>
                </div>
            </div>
            <div class="col-3">
                <div class="card border-0 mb-3">
                    <div class="card-header bg-white">
                        热门排行
                    </div>
                    <ul class="list-group list-group-flush">
                        <portal:articles limit="5" order="post.post_hits DESC" categoryIds="">
                            <php>$top=$key
                                <3? "top3": "";</php>
                                    <li class="{$top} list-group-item text-truncate">
                                        <i>{$key+1}</i>
                                        <a title="{$vo.post_title}" href="{:cmf_url('portal/Article/index',array('id'=>$vo['id']))}">
                                   {$vo.post_title}
                                </a>
                                    </li>
                        </portal:articles>
                    </ul>
                </div>
                <div class="card border-0 mb-3">
                    <div class="card-header bg-white">
                        最新话题
                    </div>
                    <ul class="list-group list-group-flush">
                        <portal:articles limit="5" order="post.published_time DESC" categoryIds="">
                            <php>$top=$key
                                <3? "top3": "";</php>
                                    <li class="{$top} list-group-item text-truncate">
                                        <i>{$key+1}</i>
                                        <a title="{$vo.post_title}" href="{:cmf_url('portal/Article/index',array('id'=>$vo['id']))}">
                                   {$vo.post_title}
                                </a>
                                    </li>
                        </portal:articles>
                    </ul>
                </div>
            </div>
        </div>
    </section>
    <include file="public@footer" />
    <include file="public@scripts" />
</body>

</html>